type box<T,K>={
    name:T
    kind:K
}

let b:box<string,string>={
    name:"黄紫红",
    kind:"超级无敌美味软糯热乎乎新鲜的富婆荔枝请我吃疯狂星期四"
}

console.log(b)

interface Ypr{
    nums:number,
    Hua:string
}

let r:Ypr={
    nums:50,
    Hua:"vme50"
}

interface Brown<T>{
    nums:number,
    Hua:T
}
let re:Brown<string>={
    nums:50,
    Hua:"vme50"
}

let Huang:Brown<number>={
    nums:12,
    Hua:2402
}

let Zi:Brown<{name:string,age:number,height:string}>={
    nums:111,
    Hua:{
        name:"年长黄紫红",
        age:999,
        height:"300cm"
    }
}
console.log(Zi)
console.log(re)
console.log(r)

//泛型默认值
type Rres<T=string>={
    name:T
}
let rrr:Rres<number>={
    name:444
}
//默认unkown
type donKown<T=unknown>={
    name:T
}
let ress:donKown={
    name:"wow"
}

//作业
//类型工具
//ts内置了几个类型工具:可以改变类型，是类型的变形器
interface Ypr2{
    nums:number,
    Hua:string
}
type new_Ypr2=Partial<Ypr2>
let rrrrrr:new_Ypr2={
    nums:23,
    Hua:"1"
}